//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Exception Handling Application Block
//===============================================================================

using System;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;

namespace EntLibContrib.ExceptionHandling.Configuration.Design
{
	/// <summary>
	/// Configuration design manager for exception handling
	/// </summary>
	public sealed class ExceptionHandlingConfigurationDesignManager : ConfigurationDesignManager
	{
		#region Public Methods
		/// <summary>
		/// When overridden by a class, Register any mechanisms needed for the design manager into the design time.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		public override void Register(IServiceProvider serviceProvider)
		{
			ExceptionHandlingCommandRegistrar cmdRegistrar = new ExceptionHandlingCommandRegistrar(serviceProvider);
			cmdRegistrar.Register();
			ExceptionHandlingNodeMapRegistrar nodeRegistrar = new ExceptionHandlingNodeMapRegistrar(serviceProvider);
			nodeRegistrar.Register();
		}

		/// <summary>
		/// Initializes the EntLibExtensions.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The root node of the application.</param>
		/// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{
			base.OpenCore(serviceProvider, rootNode, section);
		}
		#endregion
	}
}
